﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caliburn.Micro;
using System.ComponentModel.Composition;
using System.Windows.Media;
using System.Windows;
using FamilyShowSource.Events;

namespace FamilyShowSource.ViewModels
{
    [Export(typeof(DiagramAndDetailViewModel))]
    public class DiagramAndDetailViewModel : Conductor<object>
    {
        #region Fields

        /// <summary>
        /// Reference to the Diagram view
        /// </summary>
        public DiagramViewModel DiagramViewModel { get; private set; }

        /// <summary>
        /// Reference to the Detail view
        /// </summary>
        public DetailViewModel DetailViewModel { get; private set; }

        #endregion

        #region Constructors

        /// <summary>
        /// This annotation to indicate that this constructor will be used.
        /// With this constructor, Caliburn Micro will execute the following:
        /// - Create instances of the Views and pass to the constructor
        /// </summary>
        /// <param name="diagramViewModel"></param>
        /// <param name="detailViewModel"></param>
        [ImportingConstructor]
        public DiagramAndDetailViewModel(DiagramViewModel diagramViewModel, DetailViewModel detailViewModel)
        {
            this.DiagramViewModel = diagramViewModel;
            this.DetailViewModel = detailViewModel;
        }

        /// <summary>
        /// This method is invoked when the view is activated
        /// </summary>
        protected override void OnActivate()
        {
            this.DetailViewModel.CurrentPerson = App.Family.Current;
        }

        #endregion
    }

    /// <summary>
    /// Enum Values for the Family Member ComboBox.
    /// </summary>
    public enum FamilyMemberComboBoxValue
    {
        Father,
        Mother,
        Brother,
        Sister,
        Spouse,
        Son,
        Daughter,
        Existing
    }
}
